Skip to content

THRIFT-5922: made http header lookup case insensitive#3328

Merged
Jens-G merged 1 commit intoapache:masterfrom
Nighmared:THRIFT-5922
Mar 5, 2026
Merged

THRIFT-5922: made http header lookup case insensitive#3328
Jens-G merged 1 commit intoapache:masterfrom
Nighmared:THRIFT-5922

Conversation

@Nighmared
Copy link
Contributor

@Nighmared Nighmared commented Mar 3, 2026

Client: lua

The http transport client breaks when the traffic is routed through a proxy that changes the casing of the header keys. This is not only incorrect but also different from the implementation in all other languages.
This pull request changes this, so http headers are now stored/retrieved in a case insensitive matter.
Since there are no unit tests for lua (that i could find?) I did not add tests that isolate this bug, but it's quite obvious from looking at the source.

  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@mergeable mergeable bot added the lua label Mar 3, 2026
@Jens-G
Copy link
Member

Jens-G commented Mar 5, 2026

Reference: https://datatracker.ietf.org/doc/html/rfc7230#section-3.2

@Jens-G Jens-G merged commit 96b7f21 into apache:master Mar 5, 2026
79 checks passed
for key, val in string.gmatch(line, "([%w%-]+)%s*:%s*(.+)") do
if headers[key] then
local delimiter = ", "
if key == "Set-Cookie" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this line also be comparing lowercase?
now all headers are stored lower but this check is case sensitive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes definitely! I must have missed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants